const { defineConfig } = require('@vue/cli-service')
const path = require('path')

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  pages: {
    index: {
      entry: "src/main.js",
      template: "public/index.html",
      filename: "index.html",
      title: "新建标签页",
    },
    newTab: {
      entry: "src/pages/newTab/main.js",
      template: "public/newTab.html",
      filename: "newTab.html",
      title: "新建标签页",
    }
  },
  pluginOptions: {
    electronBuilder: {
      // 配置output文件夹
      outputDir: 'dist_electron',
      // 配置文件夹别名
      extraResources: [{
        from: path.resolve(__dirname, 'src/assets'),
        to: path.resolve(__dirname, 'dist_electron/source'),
        filter: ['**/*']
      }],
      externals: [
      ],
      // https://blog.csdn.net/huaxiu5/article/details/122326622
      // extraResources: [{
      //   from: 'public/lib',
      //   to: './'
      // }],

      // nodeIntegration: true,
      // 自定义文件协议
      customFileProtocol: "./",
      builderOptions: {
        asar: false,
        icon: './build_src/1.ico',
        nsis: {
          oneClick: false,
          allowElevation: false,
          allowToChangeInstallationDirectory: true,
          installerIcon: './build_src/1.ico',
          installerHeaderIcon: './build_src/1.ico'
        },
      }
    }
  }
})
